home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.11 Nov 90 / TEDrag Source / TEDrag.r < prev    next >
Encoding:
Text File  |  1990-09-21  |  7.2 KB  |  342 lines  |  [TEXT/MPS ]

  1. /* 
  2.     ©1987-89 Apple Computer. All Rights Reserved.
  3. */
  4.  
  5. #ifndef __TYPES.R__
  6. #include "Types.r"
  7. #endif
  8.  
  9. #ifndef __SYSTYPES.R__
  10. #include "SysTypes.r"
  11. #endif
  12.  
  13. #ifndef __MacAppTypes__
  14. #include "MacAppTypes.r"
  15. #endif
  16.  
  17. #ifndef __ViewTypes__
  18. #include "ViewTypes.r"
  19. #endif
  20.  
  21.  
  22. #if qDebug
  23. include "Debug.rsrc";
  24. #endif
  25.  
  26. include "MacApp.rsrc";
  27. include "Printing.rsrc";
  28.  
  29. include "TEOther.rsrc";    /* DLOG & DITL 1001; ICON 256,257; ICN# 128,129 */
  30. include "TEDrag" 'CODE';
  31.  
  32. #define cHelp         1001
  33. #define cDrawBox    2001
  34. #define cDragBox    3001
  35.  
  36. #define cBlack     5001
  37. #define cBlue         5002
  38. #define cGreen     5003
  39. #define cRed         5004
  40. #define cWhite     5005
  41.  
  42. #define kSignature        'JLMT'
  43. #define kDocFileType        'JL01'
  44. #define getInfoString    "©1990 J.Langowski/MacTutor. Translated from MacApp® Pascal."
  45.  
  46. /* ------------------------------------------------------------------------------------*/
  47. resource 'WIND' (1001, purgeable) {
  48.     {50, 20, 250, 450},
  49.     zoomDocProc,
  50.     invisible,
  51.     goAway,
  52.     0x0,
  53.     "<<<>>>"
  54. };
  55.  
  56.  
  57. /* ------------------------------------------------------------------------------------*/
  58. resource 'DITL' (201, purgeable) {
  59.      {    /* array DITLarray: 3 elements */
  60.         /* [1] */
  61.         {130, 182, 150, 262},
  62.         Button {
  63.             enabled,
  64.             "OK"
  65.         };
  66.         /* [2] */
  67.         {10, 80, 110, 270},
  68.         StaticText {
  69.             disabled,
  70.             "Displays text and boxes"
  71.             "\n\nThis program was written "
  72.             "with MacApp® © 1985-1989 Apple Computer, Inc."
  73.         };
  74.         /* [3] */
  75.         {10, 20, 42, 52},
  76.         Icon {
  77.             disabled,
  78.             1
  79.         }
  80.     }
  81. };
  82.  
  83. resource 'ALRT' (201, purgeable) {
  84.     {90, 100, 250, 412},
  85.     201,
  86.     {
  87.         OK, visible, silent;
  88.         OK, visible, silent;
  89.         OK, visible, silent;
  90.         OK, visible, silent
  91.     }
  92. };
  93.  
  94.  
  95. /* ------------------------------------------------------------------------------------*/
  96. resource 'cmnu' (1) {
  97.     1,
  98.     textMenuProc,
  99.     0x7FFFFFFB,
  100.     enabled,
  101.     apple,
  102.      {
  103.         "About TEDemo…", noIcon, noKey, noMark, plain, cAboutApp;
  104.         "Help…", noIcon, "H", noMark, plain, cHelp;
  105.         "-", noIcon, noKey, noMark, plain, nocommand
  106.     }
  107. };
  108.  
  109. resource 'cmnu' (2) {
  110.     2,
  111.     textMenuProc,
  112.     allEnabled,
  113.     enabled,
  114.     "File",
  115.      {
  116.         "New", noIcon, "N", noMark, plain, 10;
  117.         "Open…", noIcon, "O", noMark, plain, 20;
  118.         "-", noIcon, noKey, noMark, plain, nocommand;
  119.         "Close", noIcon, noKey, noMark, plain, 31;
  120.         "Save", noIcon, "S", noMark, plain, 30;
  121.         "Save As…", noIcon, noKey, noMark, plain, 32;
  122.         "Save a Copy In…", noIcon, noKey, noMark, plain, 33;
  123.         "-", noIcon, noKey, noMark, plain, nocommand;
  124.         "Page Setup…", noIcon, noKey, noMark, plain, 176;
  125.         "Print One", noIcon, "P", noMark, plain, 177;
  126.         "Print…", noIcon, noKey, noMark, plain, 178;
  127.         "-", noIcon, noKey, noMark, plain, nocommand;
  128.         "Quit", noIcon, "Q", noMark, plain, 36
  129.     }
  130. };
  131.  
  132. resource 'cmnu' (3) {
  133.     3,
  134.     textMenuProc,
  135.     allEnabled,
  136.     enabled,
  137.     "Edit",
  138.      {
  139.         "Undo", noIcon, "Z", noMark, plain, 101;
  140.         "-", noIcon, noKey, noMark, plain, nocommand;
  141.         "Cut", noIcon, "X", noMark, plain, 103;
  142.         "Copy", noIcon, "C", noMark, plain, 104;
  143.         "Paste", noIcon, "V", noMark, plain, 105;
  144.         "Clear", noIcon, noKey, noMark, plain, 106;
  145.         "-", noIcon, noKey, noMark, plain, nocommand;
  146.         "Show Clipboard", noIcon, noKey, noMark, plain, 35
  147.     }
  148. };
  149.  
  150. resource 'cmnu' (4) {
  151.     4,
  152.     textMenuProc,
  153.     allEnabled,
  154.     enabled,
  155.     "TextColor",
  156.      {
  157.         "Black", noIcon, noKey, noMark, plain, cBlack;
  158.         "Blue", noIcon, "B", noMark, plain, cBlue;
  159.         "Green", noIcon, "G", noMark, plain, cGreen;
  160.         "Red", noIcon, "R", noMark, plain, cRed;
  161.         "White", noIcon, noKey, noMark, outline, cWhite
  162.     }
  163. };
  164.  
  165. resource 'cmnu' (128) {
  166.     128,
  167.     textMenuProc,
  168.     allEnabled,
  169.     enabled,
  170.     "Buzzwords",    /* these words appear after Undo in the Edit menu */
  171.      {
  172.         "Page Setup Change", noIcon, noKey, noMark, plain, cChangePrinterStyle;
  173.         "Typing", noIcon, noKey, noMark, plain, cTyping;
  174.         "Drawing",  noIcon, noKey, noMark, plain, cDrawBox;
  175.         "Dragging",  noIcon, noKey, noMark, plain, cDragBox
  176.     }
  177. };
  178.  
  179. resource 'MBAR' (128) {
  180.     {1; 2; 3; 4}
  181. };
  182.  
  183.  
  184. resource 'mctb' (128) {
  185.     {
  186.     /* Blue */
  187.     4, 2,
  188.         {
  189.         0x0000, 0x0000, 0xFFFF;            /* Mark color */
  190.         0x0000, 0x0000, 0xFFFF;            /* Name color */
  191.         0x0000, 0x0000, 0xFFFF;            /* Command Key color */
  192.         0xFFFF, 0xFFFF, 0xFFFF            /* Background color */
  193.         };
  194.     /* Green */
  195.     4, 3,
  196.         {
  197.         0x0000, 0xDB00, 0x0000;            /* Mark color */
  198.         0x0000, 0xDB00, 0x0000;            /* Name color */
  199.         0x0000, 0xDB00, 0x0000;            /* Command Key color */
  200.         0xFFFF, 0xFFFF, 0xFFFF            /* Background color */
  201.         };
  202.     /* Red */
  203.     4, 4,
  204.         {
  205.         0xDB00, 0x0000, 0x0000;            /* Mark color */
  206.         0xDB00, 0x0000, 0x0000;            /* Name color */
  207.         0xDB00, 0x0000, 0x0000;            /* Command Key color */
  208.         0xFFFF, 0xFFFF, 0xFFFF            /* Background color */
  209.         }
  210.     }
  211. };
  212.  
  213.  
  214. /* --------------------------- memory usage ----------------------------------------*/
  215. resource 'SIZE' (-1) {
  216.     saveScreen,
  217.     acceptSuspendResumeEvents,
  218.     enableOptionSwitch,
  219.     canBackground,
  220.     MultiFinderAware,
  221.     backgroundAndForeground,
  222.     dontGetFrontClicks,
  223.     ignoreChildDiedEvents,
  224.     is32BitCompatible,
  225.     reserved,
  226.     reserved,
  227.     reserved,
  228.     reserved,
  229.     reserved,
  230.     reserved,
  231.     reserved,
  232. #if qDebug
  233.     640 * 1024,
  234.     512 * 1024
  235. #else
  236.     240 * 1024,
  237.     220 * 1024
  238. #endif
  239. };
  240.  
  241.  
  242. resource 'seg!' (256, purgeable) {
  243.     {
  244.         "GClose";
  245.         "GDoCommand";
  246.         "GNonRes";
  247.         "GFile";
  248.         "GOpen";
  249.         "GSelCommand";
  250.     }
  251. };
  252.  
  253. resource 'mem!' (256, purgeable) {
  254.     30 * 1024,        /* Add to temporary reserve */
  255.     0,                    /* Add to permanent reserve */
  256.     0                    /* Add to stack space */
  257. };
  258.  
  259.  
  260. /* -------------------------- Bundle resources -------------------------------------*/
  261. type kSignature as 'STR ';
  262.  
  263. resource kSignature (0) {
  264.     getInfoString;
  265. };
  266.  
  267. resource 'FREF' (128) {
  268.     'APPL', 0, "TEDrag"    /* Show application file with ICN# with local ID 0 */
  269. };
  270.  
  271. resource 'FREF' (129) {
  272.     kDocFileType, 1, "TEDrag"    /* Show document files with ICN# with local ID 1 */
  273. };
  274.  
  275. resource 'BNDL' (128) {
  276.     kSignature,        /* Application signature (creator) */
  277.     0,                /* Resource ID of version data */
  278.     {
  279.         'ICN#',    /* This is how to map local ICN# ids into resource IDs */
  280.         {
  281.             0, 128;    /* Local ICN# 0 is in resource 128 */
  282.             1, 129    /* Local ICN# 1 is in resource 129 */
  283.         };
  284.         'FREF',    /* This is how to map local FREF ids into resource IDs */
  285.         {
  286.             0, 128;    /* Local FREF 0 (arbitrary) is in resource 128 */
  287.             1, 129    /* Local FREF 1 (also arbitrary) is in resource 129 */
  288.         }
  289.     }
  290. };
  291.  
  292. /*--------------------------------------------------------------------------------
  293.  The overall package version
  294. --------------------------------------------------------------------------------*/
  295. RESOURCE 'vers' (2,
  296. #if qNames
  297. "Package Version",
  298. #endif
  299.     purgeable) {
  300.     0x02,
  301.     0x00,
  302.     beta,
  303.     0x06,
  304.     verUs,
  305.     "2.0ß9",
  306.     "MacApp® 2.0ß9, ©Apple Computer, Inc. 1989"
  307. };
  308.  
  309.  
  310. /*--------------------------------------------------------------------------------
  311.  The revision of this particular file
  312. --------------------------------------------------------------------------------*/
  313. RESOURCE 'vers' (1,
  314. #if qNames
  315. "File Version",
  316. #endif
  317.     purgeable) {
  318.     0x01,
  319.     0x00,
  320.     beta,
  321.     0x05,
  322.     verUs,
  323.     "TEDrag",
  324.     "v 0.0, ©JL/MacTutor 1990"
  325. };
  326.  
  327. /* =============================== debug window ================================= */
  328. resource 'dbug' (kDebugParamsID,
  329. #if qNames
  330. "Debug",
  331. #endif
  332.     purgeable) {
  333.         {350, 4, 474, 636},        /* Bounding rect for debug window */
  334.         1,                             /* Debug window font rsrc ID (normal = monaco) */
  335.         9,                                 /* Debug window font size (normal = 9) */
  336.         100,                            /* Number of lines */
  337.         100,                            /* Width of lines in characters */
  338.         true,                            /* open initially */
  339.         "Jörg's Debug Window"    /* Window title */
  340. };
  341.  
  342.